﻿@model List<CubicFWNet.Data.ViewModal.InventoryUserView>
@{
    ViewBag.Title = "订单库存";
    var noOrder = ViewBag.NoOrder as CubicFWNet.Data.ViewModal.OrderRelationView;
    Layout = "~/Views/Shared/_InfoPage.cshtml";
}
<section class="content">
    <div class="form-horizontal">
        <div class="box box-solid">
            <div class="box-body">
                <table class="footable table table-stripped table-bordered table-hover" id="footable" data-page-size="20" data-filter=#filter>
                    <thead>
                        <tr>
                            <th data-sort-ignore="true">
                                销售员
                            </th>
                            <th data-hide="phone,tablet" data-sort-ignore="true">
                                内部订单号
                            </th>
                            <th data-hide="phone,tablet" data-sort-ignore="true">
                                客户订单号
                            </th>
                            <th data-hide="phone,tablet" data-sort-ignore="true">
                                库存数量
                            </th>
                            <th>
                                转库存
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @if (null != Model)
                        {
                            foreach (var item in Model)
                            {
                                <tr>
                                    <td>
                                        @if (item.OrderID == new Guid())
                                        {
                                        <span>@noOrder.UserName</span>
                                        }
                                        else
                                        {
                                        @Html.DisplayFor(modelItem => item.SellerName)
                                        }
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Number)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.CusNumber)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Amount)
                                    </td>
                                    <td>
                                        <span class="btn bg-blue btn-xs" onclick="ChangeInventory('@item.Id')">转库存</span>
                                    </td>
                                </tr>

                            }
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>

<script>
    function ChangeInventory(id) {
        top.location.href = "ChangeInventory?ID=" + id;
    }
</script>